package net.devkit.core.pojo.db;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import net.devkit.core.pojo.DevCommandPOJO;


/**
 * The persistent class for the dept database table.
 * 
 */
@Entity
@Table(name="dept")
public class Dept extends DevCommandPOJO<Dept> {
	private static final long serialVersionUID = -276133484053304161L;
	private int id;
	private String deptCode;
	private String deptDesc;
	private String deptName;
	private List<User> users;

	public Dept() {
	}

	
	public Dept(int id) {
		super();
		this.id = id;
	}


	@Id
	@Column(unique=true, nullable=false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}


	@Column(name="DEPT_CODE", length=6)
	public String getDeptCode() {
		return this.deptCode;
	}

	public void setDeptCode(String deptCode) {
		this.deptCode = deptCode;
	}


	@Column(name="DEPT_DESC", length=200)
	public String getDeptDesc() {
		return this.deptDesc;
	}

	public void setDeptDesc(String deptDesc) {
		this.deptDesc = deptDesc;
	}


	@Column(name="DEPT_NAME", length=20)
	public String getDeptName() {
		return this.deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}


	//bi-directional many-to-one association to User
	@OneToMany(mappedBy="dept")
	public List<User> getUsers() {
		return this.users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	@Override
	public int compareTo(Dept arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

}